package org.huntaway.kindergarten.service.common;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.huntaway.kindergarten.manager.DutyMng;
import org.huntaway.kindergarten.po.Duty;
import org.huntaway.kindergarten.service.KindProcessor;
import org.huntaway.kindergarten.util.GlobalCon;

public class DutySeleService  extends KindProcessor<Duty> {
	public DutySeleService() {
		super();
		baseMng = (DutyMng) sm.getMng(GlobalCon.DUTY);
	}
	@Override
	public Duty getObj() {
		return new Duty();
	}

	public ActionForward list(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ActionForward serBean = super.list(mapping, form, request, response);
		List<Duty> resLst = findList(getObj());
		request.setAttribute(RES_LST, resLst);
		return serBean;
	}

	public ActionForward query(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ActionForward serBean = super.list(mapping, form, request, response);
		List<Duty> resLst = findList(getObj());
		request.setAttribute(RES_LST, resLst);
		return serBean;
	}
	public ActionForward operate(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		item = (Duty) setValue(request, getObj());
		ActionForward serBean = super.query(mapping, form, request, response);
		return serBean;
	}
}
